package com.example.batch.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;


/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2021/7/17 16:52
 * @Description TODO
 */
@Slf4j
public class MyTasklet  implements Tasklet {

    private  String taskletName;

    public MyTasklet(String taskletName) {
        this.taskletName = taskletName;
    }

    @Override
    public RepeatStatus execute(StepContribution contribution,ChunkContext chunkContext) throws Exception {

        log.info("taskletName:{} contribution:{}  chunkContext:{}",taskletName,contribution,chunkContext);
        return RepeatStatus.FINISHED;
    }
}
